package com.shop2cn.iapi.sqoptrade.parameter.enums;

/**
 * 订单来源枚举，跟.NET版完全一致
 * 
 *
 */
public enum OrderSourceEnum {

	PC(0),

	APP(1),

	WAP(2),

	Wechat(3),

	C2CAPP(4),

	C2CWAP(5),

	C2CWechat(6),

	Other(7),
	
	/**
     * 微信小程序 mini programs
     */
    WechatMP(8),

    //分销小程序
    HunterMP(9),

	//代购神器平台小程序
    ShenqiPlatformMp(11),

    //代购神器买手独立小程序
    ShenqiSellerMp(12),
    
    //代购神器H5
    ShenqiH5Mp(13),
	
	;

	private int code;

	private OrderSourceEnum(int code) {
		this.code = code;
	}

	public int getCode() {
		return code;
	}

	public static OrderSourceEnum getOrderSourceInfo(String orderSource) {
		String source = orderSource == null ? "" : orderSource.toUpperCase();

		switch (source) {
			case "APP" :
				return OrderSourceEnum.APP;
			case "PC" :
				return OrderSourceEnum.PC;
			case "WAP" :
				return OrderSourceEnum.WAP;
			case "C2CAPP" :
				return OrderSourceEnum.C2CWAP;
			case "C2CWAP" :
				return OrderSourceEnum.C2CWAP;
			case "C2CWechat" :
				return OrderSourceEnum.C2CWechat;
			case "WECHAT" :
				return OrderSourceEnum.Wechat;
			case "WechatMP" :
				return OrderSourceEnum.WechatMP;
			case "HunterMP" :
				return OrderSourceEnum.HunterMP;
			default :
				return OrderSourceEnum.Other;
		}
	}

}
